package net.wofly.sale.order.util;


/**
 * 订单类型
 *
 * @author lign
 * @version 1.0
 * @created 26-11月-2017 11:32:53
 */
public enum OrderType {
    会员订单(1, "会员订单"),
    团购订单(2, "团购订单"),
    流通订单(3, "流通订单"),
    酒店订单(4, "酒店订单"),
    签单订单(5, "签单订单"),
    宴会订单(6, "宴会订单"),
    订货会流通订单(7, "订货会订单(流通)"),
    订货会酒店订单(8, "订货会订单(酒店)"),
    还货订单(9, "还货订单"),
    无款订单(10, "无款订单");


    
    private Integer value;
    private String name;
    
    OrderType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (OrderType forEnum : values()) {
            if (value == forEnum.getValue().intValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (OrderType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}